package com.cap.bts.framework.auth.util;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;

public class SSOConfigurations {
	
	private static Map<String, String> ssoConfigurations;
	
	static {
		ssoConfigurations = new HashMap<String, String>();
		ResourceBundle mapping = ResourceBundle.getBundle("sso-config");
		Enumeration en = mapping.getKeys();
		while (en.hasMoreElements()) {
			String key = (String) en.nextElement();
			String value = mapping.getString(key);
			ssoConfigurations.put(key, value);
		}
	}

	public static String getConfig(String parameter) {
		if (ssoConfigurations.containsKey(parameter))
			return ssoConfigurations.get(parameter);
		return parameter;
	}
	
	public static void main(String[] args) {
		System.out.println(SSOConfigurations.getConfig("dealer.portal.clientId"));
	}
}
